import {useRoute, useRouter} from "vue-router";
import {reactive} from "vue";


/**
 * 获取路由
 * @param position
 * @returns []
 */
export const getRouteByType = (position = '') => {

    const router = useRouter()
    if (!position) return router.getRoutes()
    const routes = router.getRoutes().filter(route => (route.meta.position || []).includes(position))
    console.log('routes', routes)
    return routes

}